<% if @submissions.length >0 %>
<table>
  <tr>
    <th>Category of Acceptance</th>
    <th>Submitted Date</th>
    <th>Submitter</th>
    <th>Common name</th>
    <th>Number of Birds</th>
    <th>Age</th>
    <th>Sex</th>
    <th>Location</th>
    <th>Region</th>
    <th>Sight Date</th>

    <th>Media</th>
    <th>Status</th>
    <% if (isadmin? || isreviewer?) %>
		<th>Rounds</th>
	<% end %>
    <th>Date Accepted</th>
    <% if (isadmin? || isreviewer?) %>
		<th>Date Votable</th>
	<% end %>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @submissions.each do |submission| %>
  <tr class="subRow">
    <td><%= submission.s_degree %></td>
    <td><%= submission.created_on.strftime("%m/%d/%y  %I:%M%p")%></td>
    <td><%= link_to_if(isadmin?, submission.user.first_name+" "+submission.user.last_name, submission.user){submission.user.first_name+" "+submission.user.last_name}%></td>
    <td><%= submission.bird.common_name %>
		<% if submission.bird_id == 31 %>
		(<%= submission.common_name %>)
		<% end %></td>
    <td><%= submission.num_of_birds %></td>
    <td><%= submission.age %></td>
    <td><%= submission.sex %></td>
    <td><%= submission.location %></td>
    <td><%= submission.region %></td>
    <td><%= submission.sight_date_time.strftime("%m/%d/%y  %I:%M%p") if submission.sight_date_time %></td>

    <td><%= submission.media %></td>
    <td><%= submission.status.humanize if submission.status %></td>
    <% if (isadmin? || isreviewer?) %>
		<td><%= submission.rounds %></td>
    <% end %>
	<td><%= submission.date_accepted %></td>
    <% if (isadmin? || isreviewer?) %>
		<td><%= submission.date_votable.strftime("%m/%d/%y  %I:%M%p") if submission.date_votable %></td>
	<% end %>
    <td><%= link_to_if(submission.user_authorized_to_view?(session[:user]), 'Show', submission){} %></td>
    <td><%= link_to_if(submission.user_authorized_to_edit?(session[:user]), 'Edit', edit_submission_path(submission)){} %></td>
    <td><%= link_to_if(submission.user_authorized_to_destroy?(session[:user]), 'Destroy', submission, confirm: 'Are you sure?', method: :delete){} %></td>
  </tr>
<% end %>
</table>

<br />
<%= will_paginate @submissions %>

<% else %>
No submissions found. <br />
<% end %>